/*
 * net.lc4ever.framework.security.domain.StartWithUrlMatcher.java created by Q-Wang on 2009-2-2 下午08:35:04
 */
package com.ctvit.framework.security;

import org.springframework.security.web.util.UrlMatcher;


/**
 * @author Q-Wang
 *
 */
public class StartWithUrlMatcher implements UrlMatcher {

	/**
	 * @see org.springframework.security.web.util.UrlMatcher#compile(String)
	 */
	public Object compile(String urlPattern) {
		return urlPattern;
	}

	/**
	 * @see org.springframework.security.web.util.UrlMatcher#getUniversalMatchPattern()
	 */
	public String getUniversalMatchPattern() {
		return "/";
	}

	/**
	 * @see org.springframework.security.web.util.UrlMatcher#pathMatchesUrl(java.lang.Object, java.lang.String)
	 */
	public boolean pathMatchesUrl(Object compiledUrlPattern, String url) {
		return url.startsWith((String)compiledUrlPattern);
	}

	/**
	 * @see org.springframework.security.web.util.UrlMatcher#requiresLowerCaseUrl()
	 */
	public boolean requiresLowerCaseUrl() {
		return false;
	}

}
